#include<iostream>
int main()
{
	int a,b,i,yu=1,a1,b1;
	while(scanf("%d%d",&a,&b)!= EOF)
	{
	a1=a;
	b1=b;
	if(a>b)
	{
		while(yu!=0)
		{
			yu=a%b;
			a=b;
			b=yu;
		}
		printf("%d ",a);
	}
	else
	{
		while(yu!=0)
		{
			yu=b%a;
			b=a;
			a=yu;
		}
		printf("%d ",b);
	}
	for(i=a1;i>=1;i++)
		if((i%a1)==0&&(i%b1)==0)
			break;
	printf("%d\n",i);
	}
	return 0;
}
